package com.fmsz.physicalheadline.entity.news;

import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.fmsz.physicalheadline.activitys.news.FocusImageActivity;
import com.fmsz.physicalheadline.activitys.news.FocusSecTypeActivity;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.Property;

import java.util.Date;
import org.greenrobot.greendao.annotation.Generated;

/**
 * Created by Administrator on 2016/12/15.
 */
@Entity(nameInDb = "banner")
public class NewsBanners {
    @Id
    private Long id;
    @Property(nameInDb = "channel_id")
    private String channel_id;
    @Property(nameInDb = "image")
    private String image;
    private Long link;
    @Property(nameInDb = "text")
    private String text;
    @Property(nameInDb = "create_time")
    private String create_time;
    @Property(nameInDb = "title")
    private String title;
    @Property(nameInDb = "video_flag")
    private boolean video_flag;
    @Property(nameInDb = "editor")
    private String editor;
    private String channel_name,sort,delete_flag;
    private int type;

 

    @Generated(hash = 676046831)
    public NewsBanners() {
    }

    @Generated(hash = 1544072521)
    public NewsBanners(Long id, String channel_id, String image, Long link,
            String text, String create_time, String title, boolean video_flag,
            String editor, String channel_name, String sort, String delete_flag,
            int type) {
        this.id = id;
        this.channel_id = channel_id;
        this.image = image;
        this.link = link;
        this.text = text;
        this.create_time = create_time;
        this.title = title;
        this.video_flag = video_flag;
        this.editor = editor;
        this.channel_name = channel_name;
        this.sort = sort;
        this.delete_flag = delete_flag;
        this.type = type;
    }

    public String getChannel_id() {
        return channel_id;
    }

    public void setChannel_id(String channel_id) {
        this.channel_id = channel_id;
    }

    public String getChannel_name() {
        return channel_name;
    }

    public void setChannel_name(String channel_name) {
        this.channel_name = channel_name;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getDelete_flag() {
        return delete_flag;
    }

    public void setDelete_flag(String delete_flag) {
        this.delete_flag = delete_flag;
    }

    public String getEditor() {
        return editor;
    }

    public void setEditor(String editor) {
        this.editor = editor;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Long getLink() {
        return link;
    }

    public void setLink(Long link) {
        this.link = link;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public boolean isVideo_flag() {
        return video_flag;
    }

    public void setVideo_flag(boolean video_flag) {
        this.video_flag = video_flag;
    }

    public void click(Context context){
        Intent intent = new Intent();
        if (type==4) {
            intent.setClass(context, FocusImageActivity.class);
        }else if(type == 2){
            intent.setClass(context, FocusSecTypeActivity.class);
        }
        intent.putExtra("link",link);
        context.startActivity(intent);
    }

    public boolean getVideo_flag() {
        return this.video_flag;
    }
}
